﻿using MiniFox.Configurations;
using System;
using System.Collections.Specialized;
using System.Reflection;

namespace MiniFox.Components.Configurations
{
    /// <summary>
    /// 
    /// </summary>
    public interface IComponentConfig
    {
        /// <summary>
        /// 契约类型(接口或抽象类)完全限定名(FullName)
        /// </summary>
        string ContractType
        {
            get;
        }
        /// <summary>
        /// 默认组件提供者名称，该名称用于在提供者集合中查找提供者并创建实现类型
        /// </summary>
        string DefaultProvider
        {
            get;
            set;
        }
        /// <summary>
        /// 组件生成器完全限定名(FullName)
        /// </summary>
        string BuilderType
        {
            get;
        }
        /// <summary>
        /// 组件生存期策略
        /// </summary>
        ComponentLifeStyleType LifeStyle
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        ProviderSettingsCollection Providers
        {
            get;
            set;
        }
    }

    //internal class DefaultComponentConfig : IComponentConfig
    //{
    //    Type _contractType;
    //    ComponentProviderCollection _providers;
    //    internal DefaultComponentConfig(Type contractType)
    //    {
    //        _contractType = contractType;
    //        _providers = new ComponentProviderCollection();
    //        LifeStyle = ComponentLifeStyleType.Transient;
    //    }
    //    public string ContractType => _contractType.AssemblyQualifiedName;

    //    public ComponentProviderCollection Providers => _providers;

    //    public string DefaultProvider
    //    {
    //        get;
    //        set;
    //    }

    //    public string BuilderType
    //    {
    //        get;
    //        set;
    //    }

    //    public ComponentLifeStyleType LifeStyle
    //    {
    //        get;
    //        set;
    //    }

    //}
}
